package P4.T03;

public class Complex {
    private double real;
    private double imag;
    public Complex(double real, double imag) {
        this.real = real;
        this.imag = imag;
    }

    public double getModulus() {
        return Math.sqrt(real*real+imag*imag);
    }

    @Override
    public String toString() {
        return "Complex{" +
                "real=" + real +
                ", imag=" + imag +
                ", modulus=" + getModulus() +
                '}';
    }
}
